import { axios } from '@/utils/request'

const api = {
  // 商品列表
  goodsList: '/cloud/merchant/mch-get-goods-list',
  // 绑定商品
  bindGood: '/cloud/merchant/mch-set-goods-bind',
  // 创建转单
  creatTrans: '/cloud/merchant/mch-set-purchase-order',
  // 转单记录列表
  transRecord: '/cloud/merchant/mch-purchase-order-list',
  // 查询转单状态和记录
  transOrderStatus: '/cloud/merchant/mch-get-purchase-order',
  // 查询绑定商品记录
  bindRecord: '/cloud/merchant/mch-get-goods-bind-list',
  // 余额变动记录
  banlanceRecord: '/cloud/merchant/mch-get-balance-log',
  // 导入供货商商品
  leadGood: '/cloud/merchant/mch-goods-import',
  // 申请售后
  mchOrderRefundApply: '/cloud/merchant/mch-order-refund-apply',
  // 平台发货给供应商
  mchOrderRefundSend: '/cloud/merchant/mch-order-refund-send',
  getPurchaseOrderList: '/cloud/merchant/get-purchase-order-list',
  setDistributionStatus: '/cloud/merchant/set-distribution-status',
  getCloudGoodsInfo: '/cloud/merchant/get-cloud-goods-info',
}

export default api

export function goodsList(parameter) {
  return axios({
    url: api.goodsList,
    method: 'post',
    data: parameter,
  })
}

export function bindGood(parameter) {
  return axios({
    url: api.bindGood,
    method: 'post',
    data: parameter,
  })
}

export function creatTrans(parameter) {
  return axios({
    url: api.creatTrans,
    method: 'post',
    data: parameter,
  })
}

export function transRecord(parameter) {
  return axios({
    url: api.transRecord,
    method: 'post',
    data: parameter,
  })
}

export function transOrderStatus(parameter) {
  return axios({
    url: api.transOrderStatus,
    method: 'post',
    data: parameter,
  })
}

export function bindRecord(parameter) {
  return axios({
    url: api.bindRecord,
    method: 'post',
    data: parameter,
  })
}

export function banlanceRecord(parameter) {
  return axios({
    url: api.banlanceRecord,
    method: 'post',
    data: parameter,
  })
}

export function leadGood(parameter) {
  return axios({
    url: api.leadGood,
    method: 'post',
    data: parameter,
  })
}

export function mchOrderRefundApply(data) {
  return axios({
    url: api.mchOrderRefundApply,
    method: 'post',
    data,
  })
}

export function mchOrderRefundSend(data) {
  return axios({
    url: api.mchOrderRefundSend,
    method: 'post',
    data,
  })
}

export function getPurchaseOrderList(data) {
  return axios({
    url: api.getPurchaseOrderList,
    method: 'post',
    data,
  })
}

export function setDistributionStatus(data) {
  return axios({
    url: api.setDistributionStatus,
    method: 'post',
    data,
  })
}

export function getCloudGoodsInfo(data) {
  return axios({
    url: api.getCloudGoodsInfo,
    method: 'post',
    data,
  })
}
